\(\int \cos (a+b x) \sin (a+b x) \, dx\) [44]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 15 \[ \int \cos (a+b x) \sin (a+b x) \, dx=\frac {\sin ^2(a+b x)}{2 b} \]

[Out]

1/2*sin(b*x+a)^2/b

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2644, 30} \[ \int \cos (a+b x) \sin (a+b x) \, dx=\frac {\sin ^2(a+b x)}{2 b} \]

[In]

Int[Cos[a + b*x]*Sin[a + b*x],x]

[Out]

Sin[a + b*x]^2/(2*b)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2644

Int[cos[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(a*f), Subst[Int[
x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Sin[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] &&
 !(IntegerQ[(m - 1)/2] && LtQ[0, m, n])

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}(\int x \, dx,x,\sin (a+b x))}{b} \\ & = \frac {\sin ^2(a+b x)}{2 b} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(37\) vs. \(2(15)=30\).

Time = 0.01 (sec) , antiderivative size = 37, normalized size of antiderivative = 2.47 \[ \int \cos (a+b x) \sin (a+b x) \, dx=\frac {1}{2} \left (-\frac {\cos (2 a) \cos (2 b x)}{2 b}+\frac {\sin (2 a) \sin (2 b x)}{2 b}\right ) \]

[In]

Integrate[Cos[a + b*x]*Sin[a + b*x],x]

[Out]

(-1/2*(Cos[2*a]*Cos[2*b*x])/b + (Sin[2*a]*Sin[2*b*x])/(2*b))/2

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.93

method result size
derivativedivides \(\frac {\sin ^{2}\left (b x +a \right )}{2 b}\) \(14\)
default \(\frac {\sin ^{2}\left (b x +a \right )}{2 b}\) \(14\)
risch \(-\frac {\cos \left (2 b x +2 a \right )}{4 b}\) \(15\)
parallelrisch \(\frac {1-\cos \left (2 b x +2 a \right )}{4 b}\) \(19\)
norman \(\frac {2 \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b \left (1+\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )^{2}}\) \(32\)

[In]

int(cos(b*x+a)*sin(b*x+a),x,method=_RETURNVERBOSE)

[Out]

1/2*sin(b*x+a)^2/b

Fricas [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.87 \[ \int \cos (a+b x) \sin (a+b x) \, dx=-\frac {\cos \left (b x + a\right )^{2}}{2 \, b} \]

[In]

integrate(cos(b*x+a)*sin(b*x+a),x, algorithm="fricas")

[Out]

-1/2*cos(b*x + a)^2/b

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.27 \[ \int \cos (a+b x) \sin (a+b x) \, dx=\begin {cases} \frac {\sin ^{2}{\left (a + b x \right )}}{2 b} & \text {for}\: b \neq 0 \\x \sin {\left (a \right )} \cos {\left (a \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(b*x+a)*sin(b*x+a),x)

[Out]

Piecewise((sin(a + b*x)**2/(2*b), Ne(b, 0)), (x*sin(a)*cos(a), True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.87 \[ \int \cos (a+b x) \sin (a+b x) \, dx=-\frac {\cos \left (b x + a\right )^{2}}{2 \, b} \]

[In]

integrate(cos(b*x+a)*sin(b*x+a),x, algorithm="maxima")

[Out]

-1/2*cos(b*x + a)^2/b

Giac [A] (verification not implemented)

none

Time = 0.40 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.87 \[ \int \cos (a+b x) \sin (a+b x) \, dx=\frac {\sin \left (b x + a\right )^{2}}{2 \, b} \]

[In]

integrate(cos(b*x+a)*sin(b*x+a),x, algorithm="giac")

[Out]

1/2*sin(b*x + a)^2/b

Mupad [B] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.87 \[ \int \cos (a+b x) \sin (a+b x) \, dx=\left \{\begin {array}{cl} \frac {x\,\sin \left (2\,a\right )}{2} & \text {\ if\ \ }b=0\\ -\frac {\cos \left (2\,a+2\,b\,x\right )}{4\,b} & \text {\ if\ \ }b\neq 0 \end {array}\right . \]

[In]

int(cos(a + b*x)*sin(a + b*x),x)

[Out]

piecewise(b == 0, (x*sin(2*a))/2, b ~= 0, -cos(2*a + 2*b*x)/(4*b))